package com.design.abstractfactory.bmw;

import com.design.abstractfactory.CarFactory;
import com.design.abstractfactory.MiniCar;
import com.design.abstractfactory.SUVcar;

/**
 * 宝马-生产工厂实现类
 */
public class BMWCarFactory implements CarFactory {
    @Override
    public MiniCar produceMiniCar() {
        return new BMWMinicar();
    }

    @Override
    public SUVcar produceSUVCar() {
        return new BMWSUVcar();
    }
}

/**
 * 宝马迷你汽车类
 */
class BMWMinicar implements MiniCar {
    @Override
    public void show() {
        System.out.println("这是宝马迷你汽车");
    }
}

/**
 * 宝马迷你汽车类
 */
class BMWSUVcar implements SUVcar {
    @Override
    public void show() {
        System.out.println("这是宝马SUV汽车");
    }
}
